create or replace PACKAGE pkg_my_webservice IS
     FUNCTION call_myfuntion
     (
          vp_parameter1 VARCHAR2,
          vp_parameter2 VARCHAR2
     ) RETURN VARCHAR2;
END pkg_my_webservice;

/

create or replace PACKAGE BODY pkg_my_webservice IS     vg_funciton_fnc VARCHAR2(256) := 'myFunction';
     vg_ws_address   VARCHAR2(255) := 'http://www.mywebservice.com/web';

     FUNCTION call_myfuntion(
                             --lets assume that it inputs two parameters called string1, string2
                             vp_parameter1 VARCHAR2,
                             vp_parameter2 VARCHAR2)

      RETURN VARCHAR2 AS
          ol_req  soap_api.t_request;
          ol_resp soap_api.t_response;
     BEGIN
          -- we initilize a new request
          ol_req := soap_api.new_request(vg_funciton_fnc,
                                         'xmlns="' || vg_ws_address || '"');
          -- we started to add parameters
          soap_api.add_parameter(ol_req,
                                 'string1',
                                 'partns:string',
                                 vp_parameter1);

          soap_api.add_parameter(ol_req,
                                 'string2',
                                 'partns:string',
                                 vp_parameter1);

          -- we call the web service
          ol_resp := soap_api.invoke(ol_req, vg_ws_address, vg_funciton_fnc);
          -- we get back the results
          RETURN soap_api.get_return_value(ol_resp,
                                           'result', -- result tag name
                                           'xmlns:m="' || --can be change as "xmlns:n1"
                                           vg_ws_address || '"');

     END call_myfuntion;
END pkg_my_webservice;
